package com.ruitu.ssmic;

import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;

import com.ruitu.arad.base.BaseActivity;

public class StartActivityActivity extends BaseActivity {

    private boolean isDestroy = false;

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_start_activity;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // 隐藏标题栏
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        // 隐藏状态栏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (!isDestroy) {
                    startActivity(MainActivity.class);
                    finish();
                }
            }

        }, 1600);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        isDestroy = true;
    }
}
